<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    function loadDetails(visitId){
        var startDate = $("#startDate").val();
        var endDate = $("#endDate").val();
        $("#visitId").val(visitId);
        loadDiv('billDetails','${ctx}/nurse/billDetails?visitId='+visitId+'&startDate='+startDate+'&endDate='+endDate);
      //$("#billDetails").load();
    }
    /**
    打印*
     */
    function printDetials(){
       var visitId =  $("#visitId").val();
        var startDate = $("#startDate").val();
        var endDate = $("#endDate").val();
        printPdf('${ctx}/nurse/printBillItems','id='+visitId+'&startDate='+startDate+'&endDate='+endDate);
    }
</script>
<div class="app">
        <div class="content-wrap">
            <ul class="nav nav-tabs">
                <li><a href="#" onclick="loadDiv('nurseIndexDiv','${ctx}/nurse/index')">床位列表</a></li>
                <li class="active">
                    <a href="#">一日清单</a>
                </li>
            </ul>
            <div class="row">
                <section class="panel panel-default">
                    <div class="panel-body">
                        <div class="pull-left">
                        <form:form id="searchFormDict" modelAttribute="patVisit" onsubmit="return loadDivForm('nurseIndexDiv','searchFormDict','${ctx}/nurse/dayOfList');" method="post" class="form-inline">
                                <label>当前病区：${fns:getDeptName(patVisit.wardCode,'' )} &nbsp;&nbsp;</label>
                                <lable>入病区时间:</lable><input value="${patVisit.startDate}" name="startDate" id="startDate" class="form-control Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});">&nbsp;至&nbsp;<input class="form-control Wdate" name="endDate" id="endDate" value="${patVisit.endDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});">
                                <input type="hidden" id="visitId">
                                <input name="date" id="week" class="btn btn-default" type="button" value="一周内" onclick="dateCondition('week',-7,'startDate')"/>
                                <input name="date" id="halfMonth" class="btn btn-default" type="button" value="半月内" onclick="dateCondition('halfMonth',-15,'startDate')"/>
                                <input name="date"  id="month" class="btn btn-default" type="button" value="一个月内" onclick="dateCondition('month',-30,'startDate')"/>
                            <input id="search" class="btn btn-primary" type="submit" value="查询" />
                                <input id="search" class="btn btn-primary" type="button" value="打印" onclick="printDetials();"/>
                            </form:form>
                        </div>
                    </div>
                </section>
            </div>
            <div class="row" id="topDivId">
                <div class="col-lg-4">
                    <section class="panel">
                        <div class="panel-body">
                            <table id="contentTable" class="table table-bordered mg-t datatable">
                                <thead>
                                  <tr>
                                      <th>床号</th>
                                      <th>住院号</th>
                                      <th>姓名</th>
                                  </tr>
                                </thead>
                                <tbody>
                                <c:forEach items="${list}" var="patVisit">
                                    <tr onclick="loadDetails('${patVisit.id}');">
                                        <td>${patVisit.bedRec.bedNo}</td>
                                        <td>${patVisit.visitNo}</td>
                                        <td>${patVisit.patVisitIndex.name}</td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </section>
                </div>
                <div class="col-lg-8" id="billDetails">
                   <jsp:include page="dayOfListBillDetails.jsp"></jsp:include>
                </div>
            </div>
        </div>
</div>
</div>
</div>